/**
 * @Author: 焦质晔
 * @Date: 2019/6/20
 * @Last Modified by: max.jianhua
 * @Last Modified time: 2020-11-20 15:21:28
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 三方银行信息维护 (OEM)

// 经销商查询 
// export const dealerAttach = (params) => axios.get(`${SERVER.WHOLESALES}/ttFiAccountDetail/dealerInfo/byAllInfo`,params)
export const dealerAttach = (params)=>{
  const url = `${SERVER.WHOLESALES}/tmFiTripartiteBank/dealerInfo/byAllInfo`
  return axios({
    url,
    method: 'get',
    params
  });
}

// 列表	/tmFiTripartiteBank/listRecord
export const queryList = (params) => axios.post(`${SERVER.WHOLESALES}/tmFiTripartiteBank/listRecord`, params)

// 新增	/tmFiTripartiteBank/addOne
export const addOne = (params) => axios.post(`${SERVER.WHOLESALES}/tmFiTripartiteBank/addOne`, params)

// 修改	/tmFiTripartiteBank/editOne
export const editOne = (params) => axios.post(`${SERVER.WHOLESALES}/tmFiTripartiteBank/editOne`, params)

// 详情	/tmFiTripartiteBank/selectOne?id=1
export const getDetailById = (Id) => axios.get(`${SERVER.WHOLESALES}/tmFiTripartiteBank/selectOne?id=${Id}`)

// 导入	/tmFiTripartiteBank/upload
// export const upload = (params) => axios.post(`${SERVER.WHOLESALES}/tmFiTripartiteBank/upload`, params)

// 导出	/tmFiTripartiteBank/export
export const exportExcel = (params) => axios.post(`${SERVER.WHOLESALES}/tmFiTripartiteBank/export`, params, {
  responseType: 'blob'
})
// 资金账户类型
export const getFiAccountType = (params) => axios.post(`${SERVER.WHOLESALES}/tmFiAccountType/list`, params)

// / 导出
export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);

//模板
// export const excelTemplate = (params) => axios.post(`${SERVER.WHOLESALES}/tmFiTripartiteBank/exportTemplate`, params, { responseType: 'blob' })
export const excelTemplate = (params)=>{
  const url = `${SERVER.WHOLESALES}/file/downtemplate`
  return axios({
    url,
    method: 'get',
    responseType: 'blob',
    params
  });
}
